import { ajax } from "@/utils/request"


export function userlogin(data){
    return ajax({
        url: '/login',
        method: 'post',
        data
    })
}


//请求用户列表
export function userList(data){
    return ajax({
        url: '/users',
        data
    })
}

//请求添加用户
export function userAdd(data){
    return ajax({
        url: '/users',
        method:'post',
        data
    })
}

//请求编辑用户信息
export function userEdit(data){
    return ajax({
        url: '/users/' + data.id,
        method:'put',
        data
    })
}

//请求删除用户信息
export function userdelete(data){
    return ajax({
        url: '/users/' + data.id,
        method:'delete',
        data
    })
}

// 请求分配角色
export function userAllocation(data){
    return ajax({
        url: '/users/' + data.id + '/role',
        method:'put',
        data
    })
}

//修改用户状态
export function userModifyState(data){
    return ajax({
        url: '/users/' + data.uId + '/state/' + data.type,
        method:'put',
        data
    })
}



